package com.mk.util;

/**
 * @author mk.chen
 * @date 2018-8-29
 */
public class NumberUtils {

    /**
     * 大于
     *
     * @number number
     * @number min
     * @return
     */
    public static boolean numberGt(Integer number, Integer min) {
        if (number == null || min == null) {
            return false;
        }
        return number > min;
    }

    /**
     * 大于等于
     *
     * @number number
     * @number min
     * @return
     */
    public static boolean numberGte(Integer number, Integer min) {
        if (number == null || min == null) {
            return false;
        }
        return number >= min;
    }

    /**
     * 小于
     *
     * @number number
     * @number max
     * @return
     */
    public static boolean numberLt(Integer number, Integer max) {
        if (number == null || max == null) {
            return false;
        }
        return number < max;
    }

    /**
     * 小于等于
     *
     * @number number
     * @number max
     * @return
     */
    public static boolean numberLte(Integer number, Integer max) {
        if (number == null || max == null) {
            return false;
        }
        return number <= max;
    }

    /**
     * 判断该数是否在此闭区间内
     *
     * @number number
     * @number min
     * @number max
     * @return
     */
    public static boolean numberInCloseRange(Integer number, Integer min, Integer max) {
        if (number == null || max == null || min == null) {
            return false;
        }
        return number >= min && number <= max;
    }

    /**
     * 判断该数是否在此开区间内
     *
     * @number number
     * @number min
     * @number max
     * @return
     */
    public static boolean numberInOpenRange(Integer number, Integer min, Integer max) {
        if (number == null || max == null || min == null) {
            return false;
        }
        return number > min && number < max;
    }
}
